<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="myTags" tagdir="/WEB-INF/tags/components" %>
<%@ tag language="java" pageEncoding="ISO-8859-1"%>
<%@ attribute name="update" required="true" type="beans.Content" rtexprvalue="true" %>
<%@ attribute name="contentTypeMap" required="true" type="java.util.Map" rtexprvalue="true" %>

<!-- Author: Minh-Tuan Ta -->

<div class="updateDiv">
	<c:if test="${update.contentTypeID == contentTypeMap.Post}">
		<div><span style="height:29px;float:left; margin-right:5px;"><myTags:SmallUserBlock user="${update.user }"></myTags:SmallUserBlock></span>
		<div style="clear:right;padding-left:5px;">has posted a new post, <a href="Profile?userID=${update.user.userID }">${update.contentTitle}</a>, at ${update.formattedDateCreatedString  }</div>
	</div> 
	</c:if>
	
	<c:if test="${update.contentTypeID == contentTypeMap.Comment}">
		<div><span style="float:left;margin-right:5px;"><myTags:SmallUserBlock user="${update.user }"></myTags:SmallUserBlock></span>
		<div style="clear:right;">has commented on a post of <a href="Profile?userID=${update.user.userID }">${update.user.firstName } ${update.user.lastName }</a> at ${update.formattedDateCreatedString }</div></div>
	</c:if>
	
	<c:if test="${update.contentTypeID == contentTypeMap.Photo }">
		<div><span style="float:left;margin-right:5px;"><myTags:SmallUserBlock user="${update.user }"></myTags:SmallUserBlock></span>
			<div style="clear:right;">has uploaded a photo at ${update.formattedDateCreatedString }</div>
			<a href="Photos?albumID=${update.extra }">View Photo</a>
		</div>
	</c:if>
</div>
<div class="clear"></div>